//
//  BaseValueObject.m
//  BaseCode
//
//  Created by 曹连华 on 2020/3/25.
//

#import "BaseValueObject.h"

@implementation BaseValueObject

+ (JSONKeyMapper *)keyMapper {
    return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{@"nid": @"id"}];
}

/**
 *  重写父类方法，默认可选
 *
 *  @param propertyName 属性名称
 *
 *  @return bool
 */
+ (BOOL)propertyIsOptional:(NSString *)propertyName {
    return YES;
}

+ (instancetype)voWithDict:(NSDictionary *)aDict {
    if (![aDict isKindOfClass:[NSDictionary class]]) {
        return nil;
    }

    return [[self alloc] initWithDictionary:aDict error:nil];
}

@end
